#pragma once

#include <QWidget>
#include "ui_KCPServerContainer.h"
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui { class KCPServerContainerClass; };
QT_END_NAMESPACE

class KCPClient;
class KCPServerContainer : public QWidget
{
	Q_OBJECT

public:
	KCPServerContainer(QWidget *parent = nullptr);
	~KCPServerContainer();

private slots:

	void Tick();

private:
	void OnServerClientConnected(KCPClient* client);

	void OnServerClientDisconnected(KCPClient* client);

	void OnServerClientReceived(KCPClient* client, char* data, int len);

private:
	Ui::KCPServerContainerClass *ui;
	QTimer* timer = nullptr;
};
